<script setup lang="ts">
defineProps<{
  items: string[]
  selected: string
}>()

defineEmits(['change'])
</script>

<template>
  <view class="c">
    <block
      v-for="item, index in items"
      :key="item"
    >
      <RGRadio
        :is-selected="item === selected"
        :label="item"
        @choose="(v) => $emit('change', v)"
      />
      <Spacer v-if="index !== items.length - 1" h="24" />
    </block>
  </view>
</template>
